import { createApp } from "vue";
import { createPinia } from "pinia";
import { useUserStore } from "../store";
import * as locationService from "../service/location";
import Taro from "@tarojs/taro";

import VueLazyload from "vue-lazyload";

const App = createApp({
  mounted() {},
  onLaunch() {
    // const isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
    // if (isIOS) {
    //   window.history.pushState({}, "title", "#");
    // }
    locationService.getLocation();
  },
  onShow() {},
  onHide() {},
});

App.use(createPinia());
App.use(VueLazyload, {
  preload: 1.3, //预加载高度比例，默认值是1.3
  error: "./images/th.jpg", //当图片加载失败时显示的占位图路径
  loading: "./images/jz.jpg", //在图片加载过程中显示的占位图路径
  attempt: 1, //尝试加载图片的次数，默认值是1。
});
export default App;
